﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Caching;
using System.Text;

namespace System.Hyper.Cache
{
    /// <summary>
    /// 缓存适配器 
    /// <para>--------------------------</para>
    /// <para>@Author: cnalexi@gmail.com</para> 
    /// <para>@Create: 2012/3/21</para>  
    /// </summary>
    public interface ICacheProvider
    {
        void Insert<T>(string key, T t);
        void Insert<T>(string key, T t, CacheItemPolicy policy);
        T Get<T>(string key);
        T Get<T>(string key, Func<T> GetData);
        T Get<T>(string key, Func<T> GetData, CacheItemPolicy policy);
        void Remove(string key);
        void Clear();
        void Update<T>(string key, T t);
        void Update<T>(string key, T t, CacheItemPolicy policy);
        ObjectCache MyCache { get; }
    }
}
